/*
Filename:    association_collection_const_iterator.cpp
Author:      Erik Öjebo
Date:        2009-01-10
Description: A const forward iterator for the class AssociationCollection.
*/

#ifndef ASSOCIATION_COLLECTION_CONST_ITERATOR_H_
#define ASSOCIATION_COLLECTION_CONST_ITERATOR_H_

#include "association_collection.h"
#include <list>
#include <netinet/sctp.h>

class AssociationCollection;

class AssociationCollectionConstIterator
{
public:
    AssociationCollectionConstIterator(
        AssociationCollection const * collection);

    // Checks if the iterator has reached the end of the collection.
    bool isAtEnd() const;

    // Moves the iterator to the next element in the collection.
    void operator++(int i);

    // Gets the element that the iterator points to.
    const sctp_assoc_t& data() const;

private:
    AssociationCollection const * collection;
    std::list<sctp_assoc_t>::const_iterator iterator;
};

#endif /* ASSOCIATION_COLLECTION_CONST_ITERATOR_H_ */
